#ifndef ID_GENERATOR_H
#define ID_GENERATOR_H

class IdGenerator
{
public:
  typedef unsigned int id_type;
private:
  id_type next_id;
  IdGenerator(const id_type start) { next_id = start; }
  IdGenerator(const IdGenerator& other);
  IdGenerator& operator == (const IdGenerator& other);
public:
  static IdGenerator& getInstance(const id_type start = 1)
  {
    static IdGenerator generator = IdGenerator(start);
    return generator;
  }
  id_type operator () () { return next_id++; }
};

#endif // ID_GENERATOR_H
